<%@ include file="/html/init.jsp"%>

<%
	boolean loadFileContent = ParamUtil.getBoolean(request, "loadFileContent", false);
	List<CongDanJAXB> congDanList = (List<CongDanJAXB>) portletSession.getAttribute(KSDLConstants.CONG_DAN_LIST);
%>

<portlet:actionURL name="submitUploadForm" var="submitUploadFormURL">
	<portlet:param name="mvcPath" value="<%=KSDLConstants.IMPORT_DAN_CU_90 %>"/>
</portlet:actionURL>

<aui:form action="<%=submitUploadFormURL.toString() %>" name="uploadForm" method="POST" enctype="multipart/form-data">
	<aui:input name="<%= Constants.CMD %>" type="hidden" />
	
	<aui:layout>
		<aui:column columnWidth="15">
			<label for="chonFile"><liferay-ui:message key="chon-file-can-import"/></label>
		</aui:column>
		<aui:column columnWidth="35">
			<aui:input type="file" name="congDanXML" label="" inlineField="<%= true %>" id="congDanXML"/>
		</aui:column>
		
		<aui:column columnWidth="15">
			<aui:button value="load-du-lieu" onClick="<%= portletNamespace + \"submitUploadForm(\'\"+ KSDLConstants.UPLOAD + \"\')\" %>" cssClass="btn-primary"/>
		</aui:column>
	</aui:layout>
</aui:form>

<br/>

<c:if test="<%=null != congDanList%>">
	<h4><liferay-ui:message key="du-lieu-tu-file"/></h4>
	<br/>
	<liferay-util:include page="/html/import_dan_cu_90/upload_file_content.jsp" servletContext="<%=this.getServletContext() %>"/>
</c:if>

<script type="text/javascript">
$(document).ready(function(){

	window[ksdl_namespace + 'submitUploadForm'] = function(cmd) {
		$('#' + ksdl_namespace + 'cmd').val(cmd);
		$('#' + ksdl_namespace + 'uploadForm').submit();
	};
});

</script>
